<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>解构赋值</title>
	</head>
	<body>
		<script type="text/javascript">
			//数组的解构赋值
			// let [a,b] = [1,2,5]
			// console.log(a,b,c);
			//对象的解构赋值
		    //基本语法
			let person1 = {"name":"张三","age":10,"height":180,"weight":145}
			let {name,age,height,weight} = person1;
			console.log(name)
			//完整语法1   {key1:变量名1，key2:变量名2} = 对象    
			let {name:name1} = person1;
			let obj = {
				"name":"李四",
				"detail":{
					"time":"17:21"
				}
			}
			console.log({detail:{time}} = obj);
		</script>
	</body>
</html>
